home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
oper_sys
/
emerald
/
emrldsys.lha
/
Language
/
Compiler
/
map.h
< prev
next >
Wrap
C/C++ Source or Header
|
1990-08-16
|
983b
|
55 lines
/*
* @(#)map.h 1.2 3/18/87
*/
#ifndef map_h
#define map_h
/*
* Maps are things that map one integer onto another. There are
* create, insert, lookup, and destroy operations.
*/
typedef struct TE {
int key; /* the key for this entry */
int value; /* what we want */
} TE, *TEPtr;
typedef struct MapRecord {
TEPtr table;
int maxIndex, maxCount, count;
} MapRecord, *Map;
#define NIL ((unsigned)0x80000000)
Map Map_Create();
Map Map_CreateSized(/* count */);
/* int count */
void Map_Insert(/* map, key, value */);
/* Map map; int key, value; */
int Map_Lookup(/* map, key */);
/* Map map; int key; */
void Map_Delete(/* map, key */);
/* Map map; int key; */
void Map_Destroy(/* map */);
/* Map map; */
void Map_Print(/* map */);
/* Map map; */
#define Map_For(m, key, value) \
{ \
int index = 0; \
while (Map_FindNext((m), &index, (int *)&key, (int *)&value)) {
#define Map_Next \
} \
}
#define Map_Count(m) ((m)->count)
#endif